<template>
  <div class="type">
    <div class="typeList">
      <text class="text">已经完成安装的设备</text>
      <switcher v-model="flag"></switcher>
    </div>
  </div>
</template>
<script>
  import switcher from '@/components/switch'

  export default {
    name: 'type',
    components: { switcher },
    data () {
      return {
        flag: this.$store.state.type ? true : false
      }
    },
    watch: {
      flag (value) {
        let num = 0
        value && (num = 1)
        this.$store.commit('changeType', num)
        this.$store.dispatch('getAzddList', this)
        this.$emit('closeList')
      }
    }
  }
</script>
<style scoped>
  .type{
    width: 750px;
    background-color: rgba(0, 0, 0, 0.4);
    flex: 1;
  }
  .typeList{
    width: 750px;
    background-color: white;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    height: 100px;
    padding: 0 20px;
  }
  .text {
    color:rgba(102,102,102,1);
  }
</style>